<?php
class FormModel extends FW24H_Model {
	var $tableName = '24hfw_logs';
	var $_primaryKey = 'log_id';
	
	
	var $_cache = false;

	function add( $data) {
		$_va = $this->_validate_before_save( $data);
		if( $_va['error']) {
			return $_va;
		}
		return $this->save( $data);
	}

	function _validate_before_save( $data) {
		$error_message['log_id'] = 'not is a email address';
		$aForm['log_id'] = array( 'validate'=>'function:_is_email', 'error'=>$error_message['log_id']);
		$aFormError = $this->_form_validate( $data, $aForm);
		return ( $aFormError);
	}

	
}
